package com.example.dto;

import lombok.Data;

import java.io.Serializable;

@Data
public class PayResponse implements Serializable {

    private int code;

    private String data;

    public String sign;

    /****
     *
     * 返回成功
     * @param data
     * @param sign
     * @return
     */
    public static PayResponse ok(String data, String sign) {
        PayResponse payResponse = new PayResponse();
        payResponse.setCode(200);
        payResponse.setData(data);
        payResponse.setSign(sign);
        return payResponse;
    }

    /*****
     *
     * 返回失败
     * @param data
     * @return
     */
    public static PayResponse error(String data) {
        PayResponse payResponse = new PayResponse();
        payResponse.setCode(500);
        payResponse.setData(data);
        return payResponse;
    }
}
